<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Login</title>
    <link rel="stylesheet" href="<%=basePath%>plugins/layui/css/layui.css">
    <link rel="stylesheet" href="<%=basePath%>src/css/login.css">
</head>
<body>
<div class="kit-login">
    <div class="kit-login-bg"></div>
    <div class="kit-login-wapper">
        <h2 class="kit-login-slogan">欢迎来到 <br> ZADMIN后台管理系统V1.0</h2>
        <input type="hidden" id="errormsg" value="${error}">
        <div class="kit-login-form">
            <h4 class="kit-login-title">登录</h4>
            <form class="layui-form" action="/login.html" method="post">
                <div class="kit-login-row">
                    <div class="kit-login-col">
                        <i class="layui-icon">&#xe612;</i>
                        <span class="kit-login-input">
                            <input type="text" name="username" lay-verify="required|email" placeholder="邮箱账号" value="admin@kit.com"/>
                        </span>
                    </div>
                    <div class="kit-login-col"></div>
                </div>
                <div class="kit-login-row">
                    <div class="kit-login-col">
                        <i class="layui-icon">&#xe64c;</i>
                        <span class="kit-login-input">
                            <input type="password" name="password" lay-verify="required" placeholder="密码" value="admin@kit.com"/>
                        </span>
                    </div>
                    <div class="kit-login-col"></div>
                </div>
                <div class="kit-login-row">
                    <button class="layui-btn kit-login-btn" lay-submit="submit" lay-filter="login">登录</button>
                </div>
                <div class="kit-login-row" style="margin-bottom:0;">
                    <a href="javascript:void(0);" style="color: rgb(153, 153, 153); text-decoration: none; font-size: 13px;" id="forgot">忘记密码</a>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="<%=basePath%>plugins/polyfill.min.js"></script>
<script src="<%=basePath%>plugins/layui/layui.js"></script>
<script>
    layui.use(['layer', 'form'], function () {
        var form = layui.form,
            $ = layui.jquery;

        $('#forgot').on('click', function () {
            layer.msg('请联系管理员');
        });

        $(function(){
            var errormsg = $('#errormsg').val();
            console.log(errormsg);
            if (errormsg !=""){
                layer.msg(errormsg, {icon: 5});
            }
        });
    });
</script>
</body>
</html>